<!-- HTML header for doxygen 1.8.3.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.3.1"/>
<title>Sifteo SDK: Sifteo::Vector2&lt; T &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-style-overrides.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<center>
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Sifteo SDK" src="sdk_logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">
   &#160;<span id="projectnumber">v1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
</center>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.3.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Home</span></a></li>
      <li><a href="pages.html"><span>Guides</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>Sifteo</b></li><li class="navelem"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a> &#124;
<a href="struct_sifteo_1_1_vector2-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">Sifteo::Vector2&lt; T &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__math.html">Math</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Generalized two-element cartesian coordinate vector.  
 <a href="struct_sifteo_1_1_vector2.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="math_8h_source.html">sifteo/math.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a6c3dc401b4427e61b2f7489b1c7f127f"><td class="memTemplParams" colspan="2"><a class="anchor" id="a6c3dc401b4427e61b2f7489b1c7f127f"></a>
template&lt;typename R &gt; </td></tr>
<tr class="memitem:a6c3dc401b4427e61b2f7489b1c7f127f"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; R &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a6c3dc401b4427e61b2f7489b1c7f127f">cast</a> () const </td></tr>
<tr class="memdesc:a6c3dc401b4427e61b2f7489b1c7f127f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explicitly cast this vector to another vector type, using default C++ truncation or extension rules. <br/></td></tr>
<tr class="separator:a6c3dc401b4427e61b2f7489b1c7f127f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af6a9e2e0b6e3ea161a7f4082985640e2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#af6a9e2e0b6e3ea161a7f4082985640e2">cmul</a> (<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt; u) const </td></tr>
<tr class="memdesc:af6a9e2e0b6e3ea161a7f4082985640e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Complex multiplication.  <a href="#af6a9e2e0b6e3ea161a7f4082985640e2">More...</a><br/></td></tr>
<tr class="separator:af6a9e2e0b6e3ea161a7f4082985640e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5a6d609ccae73660eb745297e3b790e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab5a6d609ccae73660eb745297e3b790e"></a>
T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#ab5a6d609ccae73660eb745297e3b790e">len</a> () const </td></tr>
<tr class="memdesc:ab5a6d609ccae73660eb745297e3b790e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the scalar length (magnitude) of this vector. <br/></td></tr>
<tr class="separator:ab5a6d609ccae73660eb745297e3b790e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8619b4e08d26a352c6e5ce39b6f13abf"><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a8619b4e08d26a352c6e5ce39b6f13abf">len2</a> () const </td></tr>
<tr class="memdesc:a8619b4e08d26a352c6e5ce39b6f13abf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the scalar length (magnitude) of this vector, squared.  <a href="#a8619b4e08d26a352c6e5ce39b6f13abf">More...</a><br/></td></tr>
<tr class="separator:a8619b4e08d26a352c6e5ce39b6f13abf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad86b462601733010d25d3433f63f49b7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad86b462601733010d25d3433f63f49b7"></a>
T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#ad86b462601733010d25d3433f63f49b7">lenManhattan</a> () const </td></tr>
<tr class="memdesc:ad86b462601733010d25d3433f63f49b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the manhattan (city block) distance of this vector. <br/></td></tr>
<tr class="separator:ad86b462601733010d25d3433f63f49b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ab9f95e671b151a285edbf5d9e3910a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a2ab9f95e671b151a285edbf5d9e3910a">normalize</a> () const </td></tr>
<tr class="memdesc:a2ab9f95e671b151a285edbf5d9e3910a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return a normalized version of this vector.  <a href="#a2ab9f95e671b151a285edbf5d9e3910a">More...</a><br/></td></tr>
<tr class="separator:a2ab9f95e671b151a285edbf5d9e3910a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a042a8b449943323d320817177fefd746"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a042a8b449943323d320817177fefd746"></a>
<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a042a8b449943323d320817177fefd746">rotate</a> (float angle) const </td></tr>
<tr class="memdesc:a042a8b449943323d320817177fefd746"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotate this vector about the origin counterclockwise by 'angle' radians. <br/></td></tr>
<tr class="separator:a042a8b449943323d320817177fefd746"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade12515c7e8450255a50fcf594ab2107"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#ade12515c7e8450255a50fcf594ab2107">rotateI</a> (int angle) const </td></tr>
<tr class="memdesc:ade12515c7e8450255a50fcf594ab2107"><td class="mdescLeft">&#160;</td><td class="mdescRight">Rotate this vector about the origin counterclockwise by an integer multiple of 90 degrees.  <a href="#ade12515c7e8450255a50fcf594ab2107">More...</a><br/></td></tr>
<tr class="separator:ade12515c7e8450255a50fcf594ab2107"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7995e139a1436a81b9ae11e05701dabf"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7995e139a1436a81b9ae11e05701dabf"></a>
<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a7995e139a1436a81b9ae11e05701dabf">round</a> () const </td></tr>
<tr class="memdesc:a7995e139a1436a81b9ae11e05701dabf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Round a floating point vector to the nearest integer. <br/></td></tr>
<tr class="separator:a7995e139a1436a81b9ae11e05701dabf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cfe5a2ec34454542cb3f47e374c1a1c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2cfe5a2ec34454542cb3f47e374c1a1c"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a2cfe5a2ec34454542cb3f47e374c1a1c">set</a> (T _x, T _y)</td></tr>
<tr class="memdesc:a2cfe5a2ec34454542cb3f47e374c1a1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Modify this vector's value in-place. <br/></td></tr>
<tr class="separator:a2cfe5a2ec34454542cb3f47e374c1a1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe1eadf7f2797aaaa8050f79713a54ff"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe1eadf7f2797aaaa8050f79713a54ff"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#abe1eadf7f2797aaaa8050f79713a54ff">setPolar</a> (float angle, float magnitude)</td></tr>
<tr class="memdesc:abe1eadf7f2797aaaa8050f79713a54ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set this vector to a new cartesian value, given a value in polar coordinates. <br/></td></tr>
<tr class="separator:abe1eadf7f2797aaaa8050f79713a54ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa4e19356709913baf0af5d186246488c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa4e19356709913baf0af5d186246488c"></a>
<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; double &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#aa4e19356709913baf0af5d186246488c">toDouble</a> () const </td></tr>
<tr class="memdesc:aa4e19356709913baf0af5d186246488c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explicit cast to double. <br/></td></tr>
<tr class="separator:aa4e19356709913baf0af5d186246488c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a220201952b2744c3fb7228f697937826"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a220201952b2744c3fb7228f697937826"></a>
<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; float &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a220201952b2744c3fb7228f697937826">toFloat</a> () const </td></tr>
<tr class="memdesc:a220201952b2744c3fb7228f697937826"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explicit cast to float. <br/></td></tr>
<tr class="separator:a220201952b2744c3fb7228f697937826"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af333727569cabe881f2d99ab38989552"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af333727569cabe881f2d99ab38989552"></a>
<a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#af333727569cabe881f2d99ab38989552">toInt</a> () const </td></tr>
<tr class="memdesc:af333727569cabe881f2d99ab38989552"><td class="mdescLeft">&#160;</td><td class="mdescRight">Explicit cast to int. <br/></td></tr>
<tr class="separator:af333727569cabe881f2d99ab38989552"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a0eb0713d12c56bffdbbdb8d896a586d1"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a0eb0713d12c56bffdbbdb8d896a586d1">unit</a> (int side)</td></tr>
<tr class="memdesc:a0eb0713d12c56bffdbbdb8d896a586d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a unit vector corresponding to the given integer 'side'.  <a href="#a0eb0713d12c56bffdbbdb8d896a586d1">More...</a><br/></td></tr>
<tr class="separator:a0eb0713d12c56bffdbbdb8d896a586d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr class="memitem:a7362956454caca88012382934a1e94b9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7362956454caca88012382934a1e94b9"></a>
T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a7362956454caca88012382934a1e94b9">x</a></td></tr>
<tr class="memdesc:a7362956454caca88012382934a1e94b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector component X. <br/></td></tr>
<tr class="separator:a7362956454caca88012382934a1e94b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ef946409dc8f1fb0fb21f158ad12bec"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6ef946409dc8f1fb0fb21f158ad12bec"></a>
T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_sifteo_1_1_vector2.html#a6ef946409dc8f1fb0fb21f158ad12bec">y</a></td></tr>
<tr class="memdesc:a6ef946409dc8f1fb0fb21f158ad12bec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Vector component Y. <br/></td></tr>
<tr class="separator:a6ef946409dc8f1fb0fb21f158ad12bec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br/>
struct Sifteo::Vector2&lt; T &gt;</h3>

<p>Generalized two-element cartesian coordinate vector. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="af6a9e2e0b6e3ea161a7f4082985640e2"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt;T&gt; <a class="el" href="struct_sifteo_1_1_vector2.html">Sifteo::Vector2</a>&lt; T &gt;::cmul </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt; T &gt;&#160;</td>
          <td class="paramname"><em>u</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Complex multiplication. </p>
<p>Treat this vector as a complex number, and multiply it with another vector equivalently interpreted. </p>

</div>
</div>
<a class="anchor" id="a8619b4e08d26a352c6e5ce39b6f13abf"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="struct_sifteo_1_1_vector2.html">Sifteo::Vector2</a>&lt; T &gt;::len2 </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the scalar length (magnitude) of this vector, squared. </p>
<p>This avoids the costly square root calculation. </p>

</div>
</div>
<a class="anchor" id="a2ab9f95e671b151a285edbf5d9e3910a"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt;T&gt; <a class="el" href="struct_sifteo_1_1_vector2.html">Sifteo::Vector2</a>&lt; T &gt;::normalize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return a normalized version of this vector. </p>
<p>The returned vector will have a magnitude of 1.0. </p>

</div>
</div>
<a class="anchor" id="ade12515c7e8450255a50fcf594ab2107"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt;T&gt; <a class="el" href="struct_sifteo_1_1_vector2.html">Sifteo::Vector2</a>&lt; T &gt;::rotateI </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>angle</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Rotate this vector about the origin counterclockwise by an integer multiple of 90 degrees. </p>
<p>The angle must be 0, 1, 2, or 3. If you must pass larger angles, you can use umod(a, 4) to fold them into this range. </p>

</div>
</div>
<a class="anchor" id="a0eb0713d12c56bffdbbdb8d896a586d1"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="struct_sifteo_1_1_vector2.html">Vector2</a>&lt;T&gt; <a class="el" href="struct_sifteo_1_1_vector2.html">Sifteo::Vector2</a>&lt; T &gt;::unit </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>side</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create a unit vector corresponding to the given integer 'side'. </p>
<p>0 = -Y (Up) 1 = -X (Left) 2 = +Y (Down) 3 = +X (Right) </p>

</div>
</div>
<hr/>The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="math_8h_source.html">math.h</a></li>
</ul>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.3.1-->
<!-- start footer part -->
    <hr class="footer"/>
    <address class="footer">
        <p><a href="http://sifteo.com">Sifteo</a> SDK v1.0.0 <small>(see <a href="https://developers.sifteo.com/sifteosdk">all versions</a>)</small></p>
        <p>Last updated Wed Mar 27 2013, by <a href="http://www.stack.nl/~dimitri/doxygen">Doxygen</a></p>
    </address>
</body>
</html>
